<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>
	<style>
	a{
		text-decoration: none;
		color:#000;
		-webkit-tap-highlight-color:rgba(0,0,0,0);
	}
	input::-webkit-input-placeholder{
		color:red;
	}
	img{
		-webkit-touch-callout:none;
	}
	p{
		-webkit-user-select:none;
	}
	</style>
</head>
<body>
	
<div>
	<input type="text" autocapitalize='off'>
</div>


<div>
	<form action="" onsubmit="return false" id='myForm'>
		<input type="search">
	</form>
</div>

<div>
	<input type="text" placeholder="请输入你的花名">
</div>

<div>
	<a href="javascript:;">小鹿线小鹿线小鹿线小鹿线鹿线小鹿线小鹿线小鹿线小鹿线小鹿线</a>
</div>


<div>
	<img src="img/1.jpg" alt="">
</div>


<p>
	老张  不错，主要是人帅
</p>


<div>
	
	<button id='btn'>拍照</button>
	
	<input type="file"  capture='camcorder' accept="image/*" style="display: none;" id='myFile'>
	
	<img src="" id="vPhoto">
	
</div>

<script>
var btn = document.getElementById('btn');
var myFile = document.getElementById('myFile');
btn.onclick = function(){
	myFile.click();
	myFile.onchange = function(){
		var myFile = document.getElementById('myFile');
		var file = myFile.files[0];
		var fileReader = new FileReader();
		fileReader.onloadend = function(){
			if( fileReader.readyState == fileReader.DONE ){
				document.getElementById('vPhoto').setAttribute('src',fileReader.result);
			}
		}
		fileReader.readAsDataURL(file);
	}
}
	
var myForm = document.getElementById('myForm');
myForm.onkeypress = function(e){
	var code = e.keyCode;
	if( code =='13' ){
		//发送ajax请求
		console.log('  已经发送ajax了 ');
		//收起软键盘
		document.activeElement.blur();
		
	}
	
}
	

</script>

	
</body>
</html>
